package com.test;

import static java.util.concurrent.TimeUnit.SECONDS;

import java.util.concurrent.TimeUnit;

import feign.Feign;
import feign.Request;
import feign.Retryer;
import feign.jackson.JacksonDecoder;
import feign.jackson.JacksonEncoder2;
import feign.okhttp.OkHttpClient;

public class GetDemo2 {

	public static void main(String[] args) {
		FeignService feignService = Feign.builder()
				.client(new OkHttpClient())
				.options(new Request.Options(200, TimeUnit.MILLISECONDS, 500, TimeUnit.MILLISECONDS, true))
				.encoder(new JacksonEncoder2())
				.decoder(new JacksonDecoder())
				.retryer(new Retryer.Default(100, SECONDS.toMillis(1), 1))
				.target(FeignService.class, "http://127.0.0.1:8083");
		// 接口在spring-webflux的com.demo.webflux.feigncore里
		RespData<Object> contributors = feignService.contributors1("/testadd");
		System.out.println(contributors);
	}

}
